﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar.SuperGrid;
using AppCommon;

namespace SyncConfig.Dialog
{
    public partial class PickScope : BaseDialog
    {
        public DataRowView SelectedRow;
        public PickScope()
        {
            InitializeComponent();
        }

        private void PickScope_Load(object sender, EventArgs e)
        {
            ADOSyncConfig ado = new ADOSyncConfig();
           DataTable tblAllScopeTable=ado.GetAllScopeInfoTable();
           DataTable tblData = null;
           foreach (DataRow row in tblAllScopeTable.Rows)
           {
               if (tblData == null)
                   tblData = ado.GetScopeInfo(row["Schema"].ToString());
               else
                   tblData.Merge(ado.GetScopeInfo(row["Schema"].ToString()));
           }
           superGridControl1.PrimaryGrid.DataSource = tblData;

        }

        private void superGridControl1_RowDoubleClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowDoubleClickEventArgs e)
        {
            GridRow row = e.GridRow as GridRow;
            SelectedRow = row.DataItem as DataRowView;
            DialogResult = DialogResult.OK;
        }
    }
}
